package com.lyb.fileserver;
import com.lyb.fileserver.filters.UrlFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.*;
/**
 * Created by 李一博 on 15:11 2019/6/26.
 */

/**
 * Created by zgq7 on 2019/6/6.
 */
@Configuration
public class SpringConfig {
//    @Bean
//    public FilterRegistrationBean<UrlFilter> filterFilterRegistrationBean(UrlFilter urlFilter) {
//        FilterRegistrationBean<UrlFilter> filterFilterRegistrationBean = new FilterRegistrationBean<>();
//
//        //拦截路径配置
//        List<String> uriList = new ArrayList<>(10);
//        uriList.add("/file/*");
//        uriList.add("/page/info");
//        uriList.add("/");
//
//        filterFilterRegistrationBean.setFilter(urlFilter);
//        filterFilterRegistrationBean.setEnabled(true);
//        filterFilterRegistrationBean.setUrlPatterns(uriList);
//        filterFilterRegistrationBean.setName("baseFilter");
//        filterFilterRegistrationBean.setOrder(1);
//
//        return filterFilterRegistrationBean;
//    }

}
